﻿using MedicalCare.Messages;
using MedicalCare.Utilities;

namespace MedicalCare.Validation
{
    public class UserLoginValidator: PreValidator, IUserLoginValidator
    {
        public AMessage IsValid(LoginMessage entity)
        {
            var msg = IsNullOrEmpty("Login User Name", entity.Name);
            if(msg.Success)
                msg = IsNullOrEmpty("Login Password", entity.Password);

            return msg;
        }
    }
}
